/*
* 1. 数据模拟
* */
var leaves = Mock.mock({
    "list|5": [
        {
            "id|+1": 1,
            "emp_name": "@cname",// 占位符，随机中文名称
            "emp_dept|1": ["人事部", "开发部", "财务部"],
            "leave_type|1": ["事假", "病假"],
            "check_type|1": ["通过", "驳回"]
        }
    ]
})


var leave_type = [
    {
        id: 1,
        name: "事假1"
    }, {
        id: 2,
        name: "病假"
    }]

var check_type = [
    {
        id: 1,
        name: "通过"
    }, {
        id: 2,
        name: "驳回"
    }
]

/**
 * 2. ajax 拦截
 * */
Mock.mock("http://test.org/leave/list", "get", leaves.list)
Mock.mock("http://test.org/leave/type", "get", leave_type);
Mock.mock("http://test.org/leave/check_type", "get", check_type);